import request from '../utlis/request';

// 获取购物车页数据
export const getCarData=(data)=>{
    return request({
        url:"/routes/api/index/getCarData",
        method:"POST",
        data,
    })
}
// 点击结算 把需要购买的商品发送到后台保存数据库
export const shopp=(data)=>{
    return request({
        url:"/routes/api/index/shopp",
        method:"POST",
        data,
    })
}

// 全选反选的接口
export const chooseShop=(data)=>{
    return request({
        url:"/routes/api/index/chooseShop",
        method:"POST",
        data,
    })
}

// 提交订单
export const submitShops=(data)=>{
    return request({
        url:"/routes/api/index/submitShops",
        method:"POST",
        data,
    })
}

// 对应账户的默认收获地址
export const getShopAddress=(data)=>{
    return request({
        url:"/routes/api/index/getShopAddress",
        method:"POST",
        data,
    })
}


// 删除接口     参数：商品id 用户id( JSON.parse(localStorage.get('token')).uid )
// 移入收藏夹   参数：商品id 用户id
// 计算价格     参数：商品id 用户id
// 加减商品数量 参数：flag(加减) 商品id 用户id
export const changeShopsTypes=(data)=>{
    return request({
        url:"/routes/api/index/changeShopsTypes",
        method:"POST",
        data,
    })
}
export const addshopping=(data)=>{
    return request({
        url:"/routes/api/index/addshopping",
        method:"POST",
        data,
    })
}